#region Header
//=============================================================================
//                          GShield (Game Shield)
//=============================================================================
//
// Original Programmer: Shawn Jackson
// Company: WaveTech Digital Technologies (www.wtdt.com)
// Copyright: (c) 2006 WaveTech Digital Technologies, All Rights Reserved.
// Assembly: Library
// Code File Name: BannedPolicy.cs
// Code File Date: 12/8/2006
//
// Code File Info: Banned Policy Object Definiation
//=============================================================================
/*
 * UPDATES
 * -------
 *		ShawnJ	5/4/2007	(0.9.0.x): Refactoring for OSS.
 *		ShawnJ	7/16/2007	(0.9.5.x): Code Comments and Summary
 */
#endregion Header

#region License
/*
  GShield - Game Shield
  Copyright (C) 2006-2007 WaveTech Digital Technologies, Inc.
                                http://www.wtdt.com

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
#endregion License

#region Includes
using System;
using System.Text;
using System.Data.Linq;
#endregion Includes

namespace WaveTech.GShield.Library.Objects
{
    /*
	/// <summary>
	/// Defines a Banned Policy object detailing the users name and Id
	/// of the banned game and the date the game was banned.
	/// </summary>
	[Serializable]
	public class BannedPolicy
	{
		#region Private Members
		private int? m_id;
		private string m_userName;
		private int? m_gameId;
		private DateTime? m_dateBanned;
		private string m_hash;
		#endregion Private Members

		#region Public Properties
		/// <summary>
		/// Id number of the Banned Game Policy
		/// </summary>
		public int? Id
		{
			get { return m_id; }
			set { m_id = value; }
		}

		/// <summary>
		/// User name of the user who is banned from the game
		/// </summary>
		public string UserName
		{
			get { return m_userName; }
			set { m_userName = value; }
		}

		/// <summary>
		/// Id number of the banned game
		/// </summary>
		public int? GameId
		{
			get { return m_gameId; }
			set { m_gameId = value; }
		}

		/// <summary>
		/// Date the game/user combination was banned
		/// </summary>
		public DateTime? DateBanned
		{
			get { return m_dateBanned; }
			set { m_dateBanned = value; }
		}

		/// <summary>
		/// Hash for the internal values
		/// </summary>
		public string Hash
		{
			get { return m_hash; }
			set { m_hash = value; }
		}

		#endregion Public Properties

		#region Public Functions
		/// <summary>
		/// Computes the SHA256 hash for this object and it's values
		/// </summary>
		/// <returns>Hash string of the this objects values</returns>
		public string ComputeHash()
		{
			StringBuilder newHash = new StringBuilder();

			if (m_userName != null)
				newHash.Append(m_userName);

			if (m_gameId != null)
				newHash.Append(m_gameId.Value.ToString());

			if (m_dateBanned != null)
				newHash.Append(m_dateBanned.Value.ToString());

			return Common.Hash.ComputeHash(newHash.ToString(), "SHA256", null);
		}

		/// <summary>
		/// Compares the internally saved hash against the current hashed values.
		/// </summary>
		/// <returns></returns>
		public bool IsHashValid()
		{
			if (m_hash == null)
				return false;

			return Common.Hash.VerifyHash(ComputeHash(), "SHA256", m_hash);
		}
		#endregion Public Functions
	}
    */
}